From 5185467c6b193f58b01b84c1f8cf6b7b38c3ed9c Mon Sep 17 00:00:00 2001 From: justbur Date: Fri, 3 Jul 2015 12:00:07 -0400 Subject: [PATCH] Arrows are more fun Also add padding between entries --- which-key.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/which-key.el b/which-key.el index 4bb33922526..54831b52829 100644 --- a/which-key.el +++ b/which-key.el @@ -91,13 +91,14 @@ length." (prefix (string-match-p "^Prefix" desc)) (desc-face (if (or prefix group) 'font-lock-keyword-face 'font-lock-function-name-face)) + (sign (if (or prefix group) "▶" "→")) (tmp-desc (which-key/truncate-description (if group (substring desc 6) desc))) (key-padding (s-repeat (- max-len-key (length key)) " ")) (padded-desc (s-pad-right max-len-desc " " tmp-desc))) - (format (concat (propertize "[" 'face 'font-lock-comment-face) "%s" - (propertize "]" 'face 'font-lock-comment-face) "%s" + (format (concat (propertize "%s%s" 'face 'font-lock-constant-face) " " + (propertize sign 'face 'font-lock-comment-face) (propertize " %s" 'face desc-face)) - key key-padding padded-desc))) + key-padding key padded-desc))) unformatted)) (defun which-key/replace-strings-from-alist (replacements) @@ -174,6 +175,7 @@ Finally, show the buffer." (setq max-len-desc (if (> max-len-desc which-key-max-description-length) (+ 2 which-key-max-description-length) ; for the .. max-len-desc) + max-len-desc (1+ max-len-desc) ; pad with one character formatted (which-key/format-matches unformatted max-len-key max-len-desc))) (with-current-buffer (get-buffer which-key--buffer) -- 2.30.2